<cfsetting enablecfoutputonly="true" />
<!--- @@displayname: List media items as teasers with thumbnails --->
<!--- @@author: Jeff Coughlin (jeff[at]jeffcoughlin[dot]com)--->

<cfimport taglib="/farcry/core/tags/webskin" prefix="skin" />
<cfimport taglib="../../tags/webskin" prefix="myskin" />

<cfset oCustomFunctions = application.stplugins.jcfarcryflvplayer.oCustomFunctions />

<!--- This hack exists because types.getView is not sending stParam to the webskin, otherwise I'd just reference stObj.stParam --->
<cfif not structKeyExists(stObj, "stParam")>
  <cfparam name="arguments" default="#structNew()#" type="struct" />
  <cfparam name="stParam" default="#structNew()#" type="struct" />
  <cfset stObj.stParam = duplicate(arguments.stParam) />
</cfif>

<cfparam name="stObj.stParam.liClass_extra" default="" />
<cfparam name="stObj.stParam.liStyle_extra" default="" />

<cfif application.stplugins.jcfarcryflvplayer.bLoadPluginCssFile is true or application.stplugins.jcfarcryflvplayer.bLoadJsFile is true>
  <cfparam name="request.count_jcFarcryFlvFile.displayFlvPlayer" default="0" />
  <cfset request.count_jcFarcryFlvFile.displayFlvPlayer = request.count_jcFarcryFlvFile.displayFlvPlayer +1 />
  <cfif request.count_jcFarcryFlvFile.displayFlvPlayer eq 1>
    <myskin:defaultHtmlHead bLoadPluginCssFile="#application.stplugins.jcfarcryflvplayer.bLoadPluginCssFile#" bLoadJsFile="#application.stplugins.jcfarcryflvplayer.bLoadJsFile#" />
  </cfif>
</cfif>

<cfif isdefined("stObj.imgTeaser") and len(stObj.imgTeaser)>
  <cfset imgSrc = application.url.webroot & stObj.imgTeaser />
<cfelse>
  <cfset imgSrc = "#application.stplugins.jcfarcryflvplayer.url.missingTeaserImage#" />
</cfif>

<cfoutput>
  <li class="teaserListItem#stObj.stParam.liClass_extra#"<cfif stObj.stParam.liStyle_extra neq ""> style="#stObj.stParam.liStyle_extra#"</cfif>>
    <div class="teaserImgWrapper">
      </cfoutput>
      <skin:buildLink objectid="#stObj.objectid#" class="teaserLinkImg">
         <cfoutput><img class="teaserImg" src="#imgSrc#" alt="#stObj.title#" /></cfoutput>
      </skin:buildLink>
    <cfoutput>
    </div>
    <div class="teaserTextWrapper">
      <div class="teaserTitle">
        </cfoutput><skin:buildLink objectid="#stObj.objectid#" class="teaserTitleLink"><cfoutput>#stObj.title#</cfoutput></skin:buildLink><cfoutput>
      </div></cfoutput>
      <cfif isdefined("stObj.teaser") and len(stObj.teaser)>
      <cfoutput>
      <div class="teaserDescription">#variables.oCustomFunctions.XHTMLParagraphFormat(stObj.teaser)#</div>
      </cfoutput>
      </cfif>
      <cfoutput>
      <div class="teaserExit">
        </cfoutput><skin:buildLink objectid="#stObj.objectid#" class="teaserExitLink"><cfoutput>Watch Video</cfoutput></skin:buildLink>
      <cfoutput>
      </div>
    </div>
  </li>
</cfoutput>

<cfsetting enablecfoutputonly="false" />